<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>复古时钟 - 罗马数字位置修正版</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #6a93cb, #a4bfef);
            font-family: 'Times New Roman', serif;
        }

        .clock-container {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .clock {
            width: 400px;
            height: 400px;
            border-radius: 50%;
            background: linear-gradient(145deg, #f0f0f0, #d9d9d9);
            box-shadow:
                0 15px 35px rgba(0, 0, 0, 0.25),
                inset 0 -10px 25px rgba(0, 0, 0, 0.1),
                inset 0 10px 15px rgba(255, 255, 255, 0.8);
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* 时钟外圈装饰 */
        .clock::before {
            content: '';
            position: absolute;
            width: 420px;
            height: 420px;
            border-radius: 50%;
            background: linear-gradient(to bottom, #c9c9c9, #e6e6e6);
            z-index: -1;
            box-shadow:
                0 5px 15px rgba(0, 0, 0, 0.2),
                inset 0 -5px 15px rgba(0, 0, 0, 0.1);
        }

        /* 中心点 */
        .center-dot {
            width: 18px;
            height: 18px;
            background: #333;
            border-radius: 50%;
            position: absolute;
            z-index: 10;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
        }

        /* 小时刻度 */
        .hour-mark {
            position: absolute;
            width: 6px;
            height: 18px;
            background: #333;
            border-radius: 3px;
            transform-origin: center 200px;
            left: calc(50% - 3px);
            top: calc(50% - 200px);
        }

        /* 分钟刻度 */
        .minute-mark {
            position: absolute;
            width: 2px;
            height: 10px;
            background: #666;
            border-radius: 1px;
            transform-origin: center 200px;
            left: calc(50% - 1px);
            top: calc(50% - 200px);
        }

        /* 指针通用样式 */
        .hand {
            position: absolute;
            transform-origin: bottom center;
            bottom: 50%;
            left: calc(50% - 3px);
            border-radius: 5px 5px 0 0;
        }

        .hour-hand {
            width: 10px;
            height: 90px;
            background: #333;
            z-index: 1;
            left: calc(50% - 5px);
        }

        .minute-hand {
            width: 6px;
            height: 130px;
            background: #555;
            z-index: 2;
            left: calc(50% - 3px);
        }

        .second-hand {
            width: 2px;
            height: 160px;
            background: #e74c3c;
            z-index: 3;
            left: calc(50% - 1px);
        }

        /* 罗马数字 */
        .roman-numeral {
            position: absolute;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
            transform: translate(-50%, -50%);
        }

        /* 时钟品牌文字 */
        .brand {
            position: absolute;
            top: 45%;
            left: 50%;
            transform: translateX(-50%);
            font-size: 14px;
            color: #333;
            letter-spacing: 2px;
            text-transform: uppercase;
        }
    </style>
</head>

<body>
    <div class="clock-container">
        <div class="clock">
            <div class="center-dot"></div>
            <div class="hand hour-hand"></div>
            <div class="hand minute-hand"></div>
            <div class="hand second-hand"></div>
            <div class="brand">Classic Timepiece</div>
            <!-- 罗马数字和刻度将通过JavaScript添加 -->
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            const clock = document.querySelector('.clock');

            // 罗马数字
            const numerals = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
            // const numerals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];

            for (let i = 0; i < 12; i++) {
                const numeral = document.createElement('div');
                numeral.className = 'roman-numeral';
                numeral.textContent = numerals[i];

                // 罗马数字角度计算
                const angle = (i * 30 + 30) * (Math.PI / 180);
                const radius = 160;
                const x = Math.sin(angle) * radius;
                const y = -Math.cos(angle) * radius;

                numeral.style.left = `calc(50% + ${x}px)`;
                numeral.style.top = `calc(50% + ${y}px)`;

                clock.appendChild(numeral);
            }

            // 添加小时刻度
            for (let i = 0; i < 12; i++) {
                const mark = document.createElement('div');
                mark.className = 'hour-mark';
                mark.style.transform = `rotate(${i * 30}deg)`;
                clock.appendChild(mark);
            }

            // 添加分钟刻度
            for (let i = 0; i < 60; i++) {
                // 跳过小时位置（每5分钟）
                if (i % 5 !== 0) {
                    const mark = document.createElement('div');
                    mark.className = 'minute-mark';
                    mark.style.transform = `rotate(${i * 6}deg)`;
                    clock.appendChild(mark);
                }
            }

            // 更新时钟时间
            function updateTime() {
                const now = new Date();
                const hours = now.getHours() % 12;
                const minutes = now.getMinutes();
                const seconds = now.getSeconds();

                const hourHand = document.querySelector('.hour-hand');
                const minuteHand = document.querySelector('.minute-hand');
                const secondHand = document.querySelector('.second-hand');

                // 计算角度（增加细微的过渡效果）
                const hourDeg = (hours * 30) + (minutes * 0.5);
                const minuteDeg = (minutes * 6) + (seconds * 0.1);
                const secondDeg = seconds * 6;

                hourHand.style.transform = `rotate(${hourDeg}deg)`;
                minuteHand.style.transform = `rotate(${minuteDeg}deg)`;
                secondHand.style.transform = `rotate(${secondDeg}deg)`;
            }

            // 初始更新
            updateTime();

            // 每秒更新
            setInterval(updateTime, 1000);
        });
    </script>
</body>

</html>